module.exports = function($scope, $state, $stateParams,$resource,$modal,toaster){  
	/* 分页
        * ========================================= */
    $scope.maxSize = 5;             //最多显示多少个按钮
    $scope.bigCurrentPage = 1;      //当前页码
    $scope.itemsPerPage = 10         //每页显示几条
    $scope.searchform = {};
    $scope.getlist = function () {
        var para = {
            pageNo:$scope.bigCurrentPage, 
            pageSize:$scope.itemsPerPage,
            apply_state : '4'
        };
        para = angular.extend($scope.searchform, para);
        $resource('/api/ac/goc/sincerityAlevelApplyService/findViewAlevelIndexList', {}, {}).
        save(para,function(res) {
            if (res.errcode !== 0) {
                toaster.error({title:"",body:res.errmsg});
                return;
            }
            console.log(res);
            $scope.objs = res.data.results;
            $scope.bigTotalItems = res.data.totalRecord;
        })
    };
     
    $scope.getlist();
    //打分
    $scope.score = function(item) {
        $scope.item = item;
        $scope.flag = 'score'
        var modalInstance = $modal.open({
          template: require('../views/ascore_info.html'),
          controller: 'ascore_info',
          size: 'lg',
          resolve: {
              item: function () {
                  return $scope.item;
              },
              flag: function () {
                return $scope.flag;
              },
          }
        });
        modalInstance.result.then(function (showResult) {	
            $scope.getlist();
        });
    };
    // 通过
    $scope.pass = function(item){
      $scope.item = item;
      $scope.flag = 'pass'
      var modalInstance = $modal.open({
        template: require('../views/apassreject_info.html'),
        controller: 'apassreject_info',
        size: 'xs',
        resolve: {
            item: function () {
                return $scope.item;
            },
            flag: function () {
              return $scope.flag;
            },
        }
      });
      modalInstance.result.then(function (showResult) {	
          $scope.getlist();
      });
    }
    // 驳回
    $scope.reject = function(item){
      $scope.item = item;
      $scope.flag = 'reject'
      var modalInstance = $modal.open({
        template: require('../views/apassreject_info.html'),
        controller: 'apassreject_info',
        size: 'xs',
        resolve: {
            item: function () {
                return $scope.item;
            },
            flag: function () {
              return $scope.flag;
            },
        }
      });
      modalInstance.result.then(function (showResult) {	
          $scope.getlist();
      });
    }
    

    
};